import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:dailypayagent/config/resource_mananger.dart';
import 'package:dailypayagent/model/transitionlist.dart';

class TranssitionListItemWidget extends StatelessWidget {
  final TransRecordList item;

  TranssitionListItemWidget(this.item);

  @override
  Widget build(BuildContext context) {
    var backgroundColor = Theme.of(context).scaffoldBackgroundColor;
    return Stack(children: <Widget>[
      Material(
        color: backgroundColor,
        child: Container(
          padding: const EdgeInsets.all(10),
          decoration: BoxDecoration(
              border: Border(
            bottom: Divider.createBorderSide(context, width: 0.7),
          )),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Image.asset(
                    ImageHelper.wrapAssets(
                        item.payMode == 1 ? 'wx_logo.png' : 'ali_logo.png'),
                    width: 40,
                    height: 40,
                  ),
                  Padding(
                    padding: const EdgeInsets.only(left: 10),
                  ),
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Text(
                        item.transState == 10 ? '收款成功' : '退款成功',
                        style: Theme.of(context).textTheme.caption,
                      ),
                      Text(item.payDate + '    ' + item.cashierName,
                          style: Theme.of(context).textTheme.caption),
                    ],
                  ),
                ],
              ),
              Text(item.orderAmt.toString())
            ],
          ),
        ),
      )
    ]);
  }
}
